package com.scen.sys.service.impl;

import com.scen.sys.domain.Permission;
import com.scen.sys.mapper.PermissionMapper;
import com.scen.sys.service.PermissionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.io.Serializable;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xyx
 * @since 2020-04-08
 */
@Service
@Transactional
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission> implements PermissionService {

	@Override
	public boolean removeById(Serializable id) {
		//根据权限或菜单id删除权限和角色表的关系表里面的数据
		PermissionMapper permissionMapper = this.getBaseMapper();
		permissionMapper.deleteRolePermissionById(id);
		return super.removeById(id);//删除权限和角色表sys_role_permission的数据
	}

	
}
